package org.xc.uvc_camera;

import android.content.Context;
import android.content.SharedPreferences;

public class SPUtil {

    public static void write(Context context,String key,String value) {
        SharedPreferences sp = context.getSharedPreferences("app", Context.MODE_PRIVATE);

        sp.edit().putString(key,value).apply();
    }

    public static String read(Context context,String key) {
        SharedPreferences sp = context.getSharedPreferences("app", Context.MODE_PRIVATE);

        return sp.getString(key,"");
    }

    public static String getPlateNumber(Context context) {
        SharedPreferences sp = context.getSharedPreferences("app", Context.MODE_PRIVATE);

        return sp.getString("plate_number","").toUpperCase();
    }
}
